<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>插入课程信息</title>
		<link href="<%=basePath%>js/calendar/skins/aqua/theme.css"
			rel="stylesheet" />
		<link href="<%=basePath%>js/validate/jquery.validate.css"
			rel="stylesheet" />
		<script type="text/javascript" src="<%=basePath%>js/jquery-1.4.2.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/validate/messages_cn.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/validate/jquery.validate.js"></script>
		<script type="text/javascript" charset="UTF-8"
			src="<%=basePath%>js/validate/messages_cn.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/calendar/calendar.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/calendar/calendar-setup.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/calendar/lang/calendar-en.js"></script>

		<script type="text/javascript">
			$(function() {
				$("#subjectForm").validate( {
					rules : {
						"subject.subName" : {
							required : true,
							maxlength : 255
						},
						"subject.hours" : {
							required : true
						},
						"subject.timesWeek" : {
							required : true,
							maxlength : 2,
							digits : true
						},
						"subject.memo" : {
							maxlength : 255
						}
					}
				})
			});
		</script>
	</head>

	<body bgcolor="#D6E0EF">
		<div align="center">
			<form id="subjectForm" method="post"
				action="BasicInfo!insertSubjectInfo">
				<table align="center">
					<tr>
						<td>
							课程名称：
						</td>
						<td align="left">
							<input type="text" name="subject.subName" id="subject.subName"
								value="" />
						</td>
					</tr>
					<tr>
						<td>
							课时：
						</td>
						<td align="left">
							<input type="text" name="subject.hours" id="subject.hours"
								value="" readonly="readonly" />
						</td>
						<td>
							<img id="dateTime"
								src="<%=basePath%>js/calendar/skins/aqua/cal.gif"
								style="cursor: pointer;" />
						</td>
					</tr>
					<tr>
						<td>
							课室：
						</td>
						<td align="left">
							<select name="arrange.id" id="arrange.id">
								<s:iterator value="arrangeList">
									<option value="<s:property value="id"/>">
										<s:property value="classRoom" />
									</option>
								</s:iterator>
							</select>
						</td>
					</tr>
					<tr>
						<td>
							班级：
						</td>
						<td align="left">
							<select name="classInfo.id" id="classInfo.id">
								<s:iterator value="classInfoList">
									<option value="<s:property value="id"/>">
										<s:property value="className" />
									</option>
								</s:iterator>
							</select>
						</td>
					</tr>
					<tr>
						<td>
							周期数：
						</td>
						<td align="left">
							<input type="text" name="subject.timesWeek"
								id="subject.timesWeek" value="" />
						</td>
					</tr>
					<tr>
						<td>
							课程类型：
						</td>
						<td align="left">
							<select name="subject.typeId" id="subject.typeId">
								<option value="0" selected="selected">
									必修
								</option>
								<option value="1">
									选修
								</option>
							</select>
						</td>
					</tr>
					<tr>
						<td>
							备注：
						</td>
						<td align="left">
							<input type="text" name="subject.memo" id="subject.memo" value="" />
						</td>
					</tr>
					<tr>
						<td></td>
						<td>
							<input type="submit" name="button" id="button" value="插入数据" />
						</td>
					</tr>
				</table>
			</form>
		</div>
		<script type="text/javascript">
	Calendar.setup( {
		inputField : "subject.hours",
		ifFormat : "%Y-%m-%d",
		showsTime : "true",
		button : "dateTime",
		step : 1
	});
</script>
	</body>
</html>
